package com.fxkj.sthjt.util;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.LineIterator;

/**
 * 大文件逐行搜索
 * 
 * @author 冯晓东
 *
 */
public class FileReader {

	public static void main(String[] args) throws IOException {
		File theFile = new File("E:\\项目\\数据迁移\\生态环境\\dbo.sql");
		LineIterator it = FileUtils.lineIterator(theFile, "UTF-8");
		try {
			while (it.hasNext()) {
				String line = it.nextLine();
				if (line.contains("106505")) {
					System.err.println(line);
				}
			}
		} finally {
			IOUtils.closeQuietly(it);
		}

	}

}
